<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>公证数据应用服务平台</title>

<link rel="stylesheet" href="/assets/plugins/style/global/css/global.css" type="text/css">
<link rel="stylesheet" href="/assets/plugins/style/global/css/index.css" type="text/css">
<link rel="stylesheet" href="/assets/css/admin/style.css?t=<?php echo time()?>" type="text/css">
<link rel="stylesheet" href="/assets/css/admin/css.css?t=<?php echo time()?>" type="text/css">
<script type="text/javascript" src="/assets/js/jquery-1.11.1.min.js"></script>
<script type="text/javascript" src="/assets/js/comm.js?t=<?php echo time()?>"></script>
<script type="text/javascript" src="/assets/plugins/layer/layer.js"></script>
<script src="/assets/plugins/style/global/js/global.js"></script>

<style>
#header {
    background: #258CEB;
}

</style>
<title>后台首页</title>

<script type="text/javascript">

var ready=1;

var kj_width;

var kj_height;

var header_height=100;

var R_label;

var R_label_one = "当前位置: 数据查询 >";



function left(init){

	var left = document.getElementById("left");

	var leftlist = left.getElementsByTagName("ul");



	for (var k=0; k<leftlist.length; k++){

		leftlist[k].style.display="none";

	}

	document.getElementById(init).style.display="block";

}



function secBoard(elementID,n,init,r_lable) {



	var elem = document.getElementById(elementID);

	var elemlist = elem.getElementsByTagName("li");

	for (var i=0; i<elemlist.length; i++) {

		elemlist[i].className = "hvr-sweep-to-bottom";

	}

	elemlist[n].className = "hvr-sweep-to-bottom active";

	R_label_one="当前位置: "+r_lable+" >";

	R_label.text(R_label_one);

    welcome();
	left(init);


}





function set_div(){

		kj_width= screen.width;
		kj_height=screen.height;

		if(kj_width<1000){kj_width=1000;}

		if(kj_height<500){kj_height=500;}

		$("#header").css('width',kj_width);

		$("#header").css('height',header_height);

		$("#left").css('height',kj_height-header_height);

	    $("#right").css('height',kj_height-header_height);

		$("#left").css('top',header_height);

		$("#right").css('top',header_height);



		$("#left").css('width',180);

		$("#right").css('width',kj_width-182);

		$("#right").css('left',182);



		$("#right_iframe").css('width',kj_width-206);

		$("#right_iframe").css('height',kj_height-244);



		$("#iframe_src").css('width',kj_width-208);

		$("#iframe_src").css('height',kj_height-245);



		$("#off_on").css('height',kj_height-245);



		var nav=$("#nav");

		nav.css("left",(kj_width-nav.get(0).offsetWidth)/2);

		nav.css("top",61);

}





$(document).ready(function(){

		set_div();

		$("#off_on").click(function(){

				if($(this).attr('val')=='open'){

					$(this).attr('val','exit');

					$("#right").css('width',kj_width);

					$("#right").css('left',1);

					$("#right_iframe").css('width',kj_width-25);

					$("iframe").css('width',kj_width-27);

				}else{

					$(this).attr('val','open');

					$("#right").css('width',kj_width-182);

					$("#right").css('left',182);

					$("#right_iframe").css('width',kj_width-206);

					$("iframe").css('width',kj_width-208);

				}

		});



		left('search');

		$(".left_date a").click(function(){

				$(".left_date li").removeClass("set");

				$(this).parent().addClass("set");

				R_label.text(R_label_one+' '+$(this).text()+' >');

				$("#iframe_src").attr("src",$(this).attr("src"));

		});



		R_label=$("#R_label");

		$('body').bind('contextmenu',function(){return false;});

		$('body').bind("selectstart",function(){return false;});



});



function api_off_on_open(key){

	if(key=='open'){

				$("#off_on").attr('val','exit');

				$("#right").css('width',kj_width);

				$("#right").css('left',1);

				$("#right_iframe").css('width',kj_width-25);

				$("iframe").css('width',kj_width-27);

	}else{

					$("#off_on").attr('val','open');

					$("#right").css('width',kj_width-182);

					$("#right").css('left',182);

					$("#right_iframe").css('width',kj_width-206);

					$("iframe").css('width',kj_width-208);

	}

}
</script>



<style>

.header_case{  position:absolute; right:10px; top:75px; color:#fff}

.header_case a{ padding-left:5px}

.header_case a:hover{ color:#fff; }



.left_date a{color:#eee;}
.left_date li span{background: url(/assets/plugins/style/global/image/narrow.png);display:inline-block; height: 35px; margin-left: 15px; width: 10px;}
.left_date{overflow:hidden;}

.left_date ul{ margin:0px; padding:0px;}

.left_date li{line-height:35px; height:35px; overflow:hidden;}

.left_date li a{ display:inline-block;text-indent:1em;  overflow:hidden;}

.left_date li:hover{ background-color:#161e22;text-decoration:none;border-bottom:1px solid #3c8dbc; color: #FFF;height: 34px; cursor: pointer;}

.left_date .set{background-color:#161e22;font-weight:bold;color:#3c8dbc;}

.left_date .head{ border-bottom:1px solid #c5e8f1; color:#FFF; font-weight:bold;background: #161e22;padding-left:15px; height: 34px;}



</style>

</head>

<body >

<?php

$user_info = $this->session->userdata("user_info");
?>

<div id="header">
	<div class="container">
				<div class="header">
					<div class="head-logo">
						<a href="/admin/main"><img style="width:95px;height:95px"  src="/assets/images/admin/logo.png" alt="" /></a>
					</div>
					<div class="top-nav" id="nav">
						<ul class="nav1">
							<li class="hvr-sweep-to-bottom active"><a href="javascript:void(0);" onClick="secBoard('nav',0,'search','数据查询');"><i><img  style="width:40px;height:40px"  src="/assets/images/admin/1.png" alt=""/></i>数据查询</a></li>
							<li class="hvr-sweep-to-bottom"><a href="javascript:void(0);" onClick="secBoard('nav',1,'analysis','>数据分析');"><i><img  style="width:40px;height:40px"  src="/assets/images/admin/2.png" alt=""/></i>数据分析</a></li>
							<li class="hvr-sweep-to-bottom "><a href="javascript:void(0);" onClick="secBoard('nav',2,'system','系统管理');"><i><img style="width:40px;height:40px"  src="/assets/images/admin/3.png" alt=""/></i>系统管理</a></li>
							<li class="hvr-sweep-to-bottom "><a href="javascript:void(0);" onClick="secBoard('nav',3,'setting','基础数据');"><i><img style="width:40px;height:40px"  src="/assets/images/admin/4.png" alt=""/></i>基础数据</a></li>

							<div class="clearfix"> </div>
						</ul>

					</div>
					<div class="clearfix"> </div>
				</div>
	</div>
	 <div class="header_case">

    欢迎您：<a href="javascript:;" title="user"><?php echo $user_info["account"] ?>&nbsp;&nbsp;</a>

     <?php echo $user_info["department_name"] ?>
		 <a href="#" onclick="change_password();" title="修改密码"  >&nbsp;&nbsp;修改密码</a>
		 <a href="<?php echo site_url('/admin') ?>" title="退出"  >&nbsp;&nbsp;退出</a>
    </div>



</div><!--header end-->

<div id="left">

    <ul class="left_date" id="search">
	        <li class="head">数据查询</li>
			<li><span></span><a href="javascript:void(0);" src="<?php echo site_url('admin/archive/archive_index')?>">数据查询</a></li>
			<li><span></span><a href="javascript:void(0);" src="<?php echo site_url('admin/archive/apply_manage')?>">申请管理</a></li>
    </ul>


	<ul class="left_date" id="analysis">
		<li class="head">数据分析</li>
		<li><span></span><a href="javascript:void(0);" src="<?php echo site_url('admin/archive/business_statistics')?>">年度业务量统计报表</a></li>
		<li><span></span><a href="javascript:void(0);" src="<?php echo site_url('admin/archive/notarial_category')?>">公证类别分析</a></li>
		<li><span></span><a href="javascript:void(0);" src="<?php echo site_url('admin/archive/notary_matter')?>">公证事由分析</a></li>
		<li><span></span><a href="javascript:void(0);" src="<?php echo site_url('admin/relation')?>">人口关系分析</a></li>
		<li><span></span><a href="javascript:void(0);" src="<?php echo site_url('admin/archive/cx_archive')?>">诚信数据库</a></li>
		<li><span></span><a href="javascript:void(0);" src="<?php echo site_url('admin/archive/real_time_data')?>">实时数据监控</a></li>
    </ul>

     <ul class="left_date" id="system">

     	<li class="head">系统管理</li>
        <li><span></span><a href="javascript:void(0);" src="/admin/user">用户管理</a></li>

    </ul>

    <ul class="left_date" id="setting">

     	<li class="head">基础数据</li>
		<li><span></span><a href="javascript:void(0);" src="<?php echo site_url('admin/customer')?>">关系数据导入</a></li>
        <li><span></span><a href="javascript:void(0);" src="<?php echo site_url('admin/archive')?>">档案管理</a></li>
        <li><span></span><a href="javascript:void(0);" src="<?php echo site_url('admin/notary_matter')?>">公证事项管理</a></li>
        <li><span></span><a href="javascript:void(0);" src="/admin/department">公证处管理</a></li>

    </ul>


</div><!--left end-->

<div id="right">

	<div class="right_top">

    	<ul class="R_label" id="R_label">

        	当前位置: 数据查询 >

        </ul>

    	<ul class="R_btn">


        </ul>

    </div>

    <div class="right_left">

    	<a href="#" val="open" title="全屏" id="off_on">全屏</a>

    </div>

    <div id="right_iframe">
         <iframe id="iframe_src" name="iframe_src" class="iframe"   frameborder="yes" border="1" marginwidth="0" marginheight="0"
          scrolling="auto" allowtransparency="yes" style="width:100%; height:100%"  src="/admin/main/welcome">

          </iframe>


    </div>

</div><!--right end-->
<script>

function  welcome() {
        var url  ="<?php echo site_url('/admin/main/welcome/').'/?'.time(); ?>";
        $("#iframe_src").attr("src",url);
}
</script>
</body>

</html>
<script type="text/javascript" src="/assets/plugins/workerman/js/swfobject.js"></script>
<script type="text/javascript" src="/assets/plugins/workerman/js/web_socket.js"></script>
<script>
	WEB_SOCKET_SWF_LOCATION = "/assets/plugins/workerman/swf/WebSocketMain.swf";
	var ws_status=1;
	var bg_int;
	var ws;
	window.onload=function(){
		ws = new WebSocket("ws://<?php echo $_SERVER["SERVER_ADDR"]?>:2348");
		ws.onerror = function() {
			ws_status=0;
			//alert("websocket未打开,请联系系统管理员");
		};
		ws.onopen=function(){
			var uid="<?php echo $_SESSION['user_info']['id']?>";
			var str='{"uid":"'+uid+'","type":"login"}';
			ws.send(str);
		};
		ws.onmessage=function(e){
			var len=$('.my_new_message_div').length+1;
			if(len>3){
				$('.my_new_message_div')[0].remove();
			}else{
				$('.message_table').css('height',180*len+'px');
				$('.message_table').css('margin-top','-'+180*len+'px');
			}
			show_message(e.data);
		};
	}
//	$(function(){
//		var group_id='<?php //echo $_SESSION["user_info"]["group_id"]?>//';
//		if(group_id=='2'){
//			$.post('<?php //echo site_url("admin/archive/get_audition_msg")?>//',{},function(rt){
//				if(rt.status=='ok'){
//					$('#unread').text(rt.rows.length);
//				}
//			},'json');
//		}
//		ws = new WebSocket("ws://<?php //echo $_SERVER["SERVER_ADDR"]?>//:2348");
//		ws.onerror = function() {
//			ws_status=0;
//			alert("websocket未打开,请联系系统管理员");
//		};
//		ws.onopen=function(){
//			var uid="<?php //echo $_SESSION['user_info']['id']?>//";
//			var str='{"uid":"'+uid+'","type":"login"}';
//			ws.send(str);
//		};
//		ws.onmessage=function(e){
//			var len=$('.my_new_message_div').length+1;
//			if(len>3){
//				$('.my_new_message_div')[0].remove();
//			}else{
//				$('.message_table').css('height',180*len+'px');
//				$('.message_table').css('margin-top','-'+180*len+'px');
//			}
//			show_message(e.data);
//		};
//
//	});

	function change_password(){
		var index = layer.open({
			type: 2,
			title: '修改密码',
			maxmin: true,
			shadeClose: false,  // 点击空白页不关闭窗口
			area : ['400px' , '300px'],
			shade: [0.2,'#fff'],
			content: "<?php echo site_url('admin/password/change_password')?>"
		});
	}

	/*
	 * 发送
	 * */
	function send_apply(str){
		if(ws_status==0){
			console.log('no websocket');
			return false;
		}
		ws.send(str);
	}

	/*
	 * 审核结果
	 * */
	function send_audition(str){
		if(ws_status==0){
			return false;
		}
		ws.send(str);
	}



	/*
	 * 显示消息
	 * */
	function show_message(data){
		var json=JSON.parse(data);
//		console.log(json);
		var html='';
		if(json.type=='apply'){
			html='<div class="my_new_message_div">' +
				'<p class="message_title"><span class="title_icon"></span><span class="title_text">消息提醒</span><span class="title_text" style="float:right;"><?php echo date("Y-m-d H:i");?></span></p>' +
				'<p class="message_content">'+json.send_message+'</p>' +
				'<p class="message_bottom"><div onclick="close_apply(this)" class="message_button" style="float:right;">关 闭</div><div onclick="open_apply(this,'+json.apply_id+')" class="message_button" style="float:right;">查 看</div></p>' +
				'</div>';
		}else if(json.type=='audition'){
			html='<div class="my_new_message_div">' +
				'<p class="message_title"><span class="title_icon"></span><span class="title_text">消息提醒</span><span class="title_text" style="float:right;"><?php echo date("Y-m-d H:i");?></span></p>' +
				'<p class="message_content">'+json.send_message+'</p>' +
				'<p class="message_bottom"><div onclick="close_apply(this)" class="message_button" style="float:right;">关 闭</div><div onclick="open_archive(this,'+json.archive_id+')" class="message_button" style="float:right;">查 看</div></p>' +
				'</div>';
		}

		$('#my_message').append(html);
	}


	/*
	 * 打开审核界面
	 * */
	function open_apply(t,apply_id){
		close_apply(t);
		var index = layer.open({
			type: 2,
			title: '档案查阅审核',
			maxmin: true,
			shadeClose: false,  // 点击空白页不关闭窗口
			area : ['1024px' , '600px'],
			shade: [0.2,'#fff'],
			content: "<?php echo site_url('admin/archive/apply_audition')?>?reload=0&id="+apply_id
		});
	}

	/*
	 * 关闭
	 * */
	function close_apply(t){
		$(t).parent().remove();
		var len=$('.my_new_message_div').length;
		$('.message_table').css('height',180*len+'px');
		$('.message_table').css('margin-top','-'+180*len+'px');
	}

	/*
	 * 打开档案
	 * */
	function open_archive(t,archive_id){
		close_apply(t);
		var index = parent.layer.open({
			type: 2,
			title: '档案明细查询',
			maxmin: true,
			shadeClose: false,  // 点击空白页不关闭窗口
			area : ['1024px' , '600px'],
			shade: [0.2,'#fff'],
			content: "<?php echo site_url('admin/archive/get_archive_status')?>?reload=0&id="+archive_id
		});
	}




</script>
<table class="message_table" cellpadding="0" cellspacing="0">
	<tr>
		<td id="my_message" valign="bottom" style="">

		</td>
	</tr>
</table>